package com.clouddot.baipai.model;


import android.content.Context;

import com.clouddot.baipai.contract.IMainFragmentContract;
import com.clouddot.baipai.http.BanPaiRetrofitHelper;
import com.clouddot.baipai.http.entity.response.getArcticByIdResponse;
import com.clouddot.baipai.http.entity.response.getArcticListResponse;
import com.clouddot.baipai.http.entity.response.getClassInfoByIdResponse;
import com.clouddot.baipai.http.entity.response.getClassInfoListResponse;
import com.clouddot.baipai.http.entity.response.getCurrentCourseResponse;
import com.clouddot.baipai.infrastructure.environment.Env;

import org.wxy.sdk.base.impl.BaseModelImpl;

import rx.Observable;

public class MainFragmentModel extends BaseModelImpl implements IMainFragmentContract.IModel {
    public MainFragmentModel(Context context) {
        super(context);

    }


    @Override
    public Observable<getClassInfoByIdResponse> getClassInfoById(String acttype, String id) {
        return BanPaiRetrofitHelper.getInstance(Env.getContent()).getServer().getClassInfoById(Env.getAppContext().IP,acttype,id);
    }

    @Override
    public Observable<getClassInfoListResponse> getClassInfo(String acttype, String TaskType, String ClassId, int pageindex, int pagesize) {
        return BanPaiRetrofitHelper.getInstance(Env.getContent()).getServer().getClassInfo(Env.getAppContext().IP,acttype,TaskType,ClassId,pageindex,pagesize);

    }

    @Override
    public Observable<getCurrentCourseResponse> getCurrentCourse(String acttype, String ClassId) {
        return BanPaiRetrofitHelper.getInstance(Env.getContent()).getServer().getCurrentCourse(Env.getAppContext().IP,acttype,ClassId);

    }
    @Override
    public Observable<getArcticListResponse> getArcticList(String acttype, String type, int pageindex, int pagesize) {
        return BanPaiRetrofitHelper.getInstance(Env.getContent()).getServer().getArcticeInfo(Env.getAppContext().IP,acttype,type,pageindex,pagesize);
    }

    @Override
    public Observable<getArcticByIdResponse> getArcticById(String acttype, String id) {
        return BanPaiRetrofitHelper.getInstance(Env.getContent()).getServer().getArcticById(Env.getAppContext().IP,acttype,id);
    }

}
